define(['jquery'], function ($) {
    var customconfig = []
    var serverConfigs = window.localStorage.getItem('customConfigs')
    if (serverConfigs) {
        customconfig = customconfig.concat(JSON.parse(serverConfigs))
    } else {
        /*$.ajax({
            url: '/yuncai/custom/getRule',
            type: 'get',
            async: false,
            success: function (data) {
                var _data = JSON.parse(data)
                if (_data.status == 1) {
                    window.localStorage.setItem('customConfigs', JSON.stringify(_data.data))
                    customconfig.concat(_data.data)
                } else {
                    console.error(_data.msg)
                }
            }
        })*/
    }
    // 跨租户的配置暂时写死在前端
    var customvalidate = [
        {
            moduleId: 'cpu-portal-fe',// 南方水泥 发的询价单报价页面 报价附件必填
            model: 'quotation',
            dataInfo: 'quotationfile',
            field: '',
            customType:'required',
            customValue: 1,
            outside: 1
        }
    ]
    var crossTenantFeature = [
        {
            moduleId: 'cpu-portal-fe',
            model: 'buyoffer',
            dataInfo: '',
            field: 'planDeptName',
            customType:'visible',
            customValue: 1,
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'buyoffer',
            dataInfo: '',
            field: 'reqOrgName',
            customType: 'visible',
            customValue: 0,
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'memo',
            customType:'visible',
            customValue: 0,
            outside: 1
        },{
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'memotext',
            customType:'visible',
            customValue: 1,
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            billType: 'quotation',
            dataInfo: 'accrate',
            field: '',
            customType:'defaultValue',
            customValue: 2,
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'suppProductName',
            customType:'labeltext',
            customValue: '品牌/产地/材质',
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'productSpec',
            customType:'visible',
            customValue: 1,
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'productType',
            customType:'visible',
            customValue: 1,
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'productDesc',
            customType:'visible',
            customValue: 0,
            outside: 1
        },
        //以下三个是供应商（规格型号存货描述or描述）
        {
            moduleId: 'cpu-portal-fe',
            model: 'buyoffer',
            dataInfo: 'productSpec',
            field: '',
            customType: 'visible',
            customValue: 1,
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'buyoffer',
            dataInfo: 'productType',
            field: '',
            customType: 'visible',
            customValue: 1,
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'buyoffer',
            dataInfo: 'productDesc',
            field: '',
            customType: 'visible',
            customValue: 0,
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'supplyDelivery',
            customType: 'placeholder',
            customValue: '系统默认为“供方负责运至需方厂内，需方收货前的一切费用及风险均由供方承担”，如供货方对此有异议请在此进行相关表述，未作表述则视同认可。',
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'supplyPayment',
            customType: 'placeholder',
            customValue: '系统默认为“供方于货到经需方初步验收合格后开具全额有效税票，于当月25日前交需方财务入账，需方按其月度付款计划为供方结算货款”，如供货方对此有异议请在此进行相关表述，未作表述则视同认可。',
            outside: 1
        },{
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'paymentInstructions',
            customType: 'labeltext',
            customValue: '付款方式说明:',
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'otherInformation',
            customType: 'labeltext',
            customValue: '其他情况说明:',
            outside: 1
        },{
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'supplyOfferDes',
            customType: 'placeholder',
            customValue: '供方认为有必要对其它相关情况进行说明的，可在此予以表述。',
            outside: 1
        }, {
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'taxrate',
            customType: 'defaultValue',
            customValue: 17,
            outside: 1
        },{
            moduleId: 'cpu-portal-fe',
            model: 'quotation',
            dataInfo: '',
            field: 'quoTemplate',
            customType:'visible',
            customValue: 0,
            outside: 1
        }
    ]
    return {
        customconfig:customconfig,
        customvalidate: customvalidate,
        crossTenantFeature: crossTenantFeature
    };
})